#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <vector>

using namespace std;

vector<int> missingTwo(vector<int>& nums) {
    int n = nums.size() + 2;
    int ret = 0;
    for (int i = 1; i <= n; ++i)
    {
        ret ^= i;
    }

    for (auto e : nums)
    {
        ret ^= e;
    }

    int pos = 0;
    for (int i = 0; i < 32; ++i)
    {
        if (((ret >> i) & 1) == 1)
        {
            pos = i;
            break;
        }
    }

    vector<int> arr1(n + 10, 0);
    vector<int> arr2(n + 10, 0);

    for (auto e : nums)
    {
        if ((e >> pos) & 1)
        {
            arr1.push_back(e);
        }
        else
        {
            arr2.push_back(e);
        }
    }

    int ret1 = 0, ret2 = 0;
    for (int i = 1; i <= n; ++i)
    {
        if ((i >> pos) & 1)
        {
            ret1 ^= i;
        }
        else
        {
            ret2 ^= i;
        }
    }

    for (auto e : arr1)
    {
        ret1 ^= e;
    }

    for (auto e : arr2)
    {
        ret2 ^= e;
    }

    return { ret1,ret2 };
}

int main()
{
	return 0;
}